import info.gridworld.grid.Location;
import java.util.ArrayList;
public class Spray extends Turret{
private static int price = 400;
	public Spray(ArrayList<Location> pa) {
		super(pa);
	}
	public void act(){
		if(cooldown == -1){
			cooldown = attackspeed;
		}
		if(cooldown == attackspeed){
			ArrayList<Enemy>enemies = new ArrayList();
			enemies = getEnemies();
			attack(enemies);
		}
		cooldown--;
	}
	public void attack(ArrayList<Enemy> enemies){
		for(int x = 0; x<enemies.size();x++){
			enemies.get(x).takeDamage(damage);
		}
	}
}
